const mysql = require("mysql2");
const config = require("../config/sqlConfig.js")

var client = mysql.createPool(config).promise()
const query = async(sql, callback)=>{
  try {
    const res = await client.query(sql)
    callback(null, res[0])
  } catch (error) {
    callback(error)
    console.log(error)
  }
}
module.exports = query